/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.hagopa.games.moneypool.game;

/**
 *
 * @author igorg
 */
//10 - sell, 20 - buy, 30 - exchange, 40 - partnership
public enum DealTypes {
    DSELL          (10, "Initiator wants to sell"),
    DBUY           (20, "Initiator wants to buy"),
    DEXCHANGE      (30, "Initiator wants to exchange"),
    DPARTNERREQ    (40, "Initiator requests for partnership"),
    DPARTNERPROP   (50, "Initiator propose partnership")
            ;
    private int idx;
    private String name = null;
    DealTypes(int ind, String name)
    {
	this.idx = ind;
	this.name = name;

    }
    public static DealTypes getEnum(int idx)
    {
		switch (idx){
                    case 10:
			return DSELL;
                    case 20:
			return DBUY;
                    case 30:
                        return DEXCHANGE;
                    case 40:
                        return DPARTNERREQ;
                    case 50:
                        return DPARTNERPROP;
                    default:
			return null;
                }
    }
    public int idx()
    {
	return this.idx;
    }
    public String getName()
    {
    	return this.name;
    }
}
